<template>
	<view>
		<lead-page v-if="isShowYindao"></lead-page>
	</view>
</template>

<script>
	import {
		ref
	} from "vue"
	import httpUtil from "@/utils/httpUtil"
	import deviceUtil from "@/utils/deviceUtil"
	import paramApi from "@/apis/paramApi"

	export default {
		onLoad(option) {
			this.initData(option)
		},
		setup() {
			const isShowYindao = ref(false)

			const initData = (option) => {
				if (deviceUtil.isWeChatBrowser()) {
					isShowYindao.value = true
					return;
				}
				let url = '/pages/ykh5_tcq/ykh5_tcq?autoSubmit=1&a=' +
					option.a + '&mobile=' + option.mobile;
				if (option.openid) {
					url += '&openid=' + option.openid
				}
				if (option.push_id && option.token) {
					url += '&push_id=' + option.push_id + '&token=' + option.token
				} else {
					url += '&param=' + option.param
				}
				console.log('lead-page', option, url)
				uni.navigateTo({
					url: url
				})
			}

			return {
				isShowYindao,
				initData,
			}
		}
	}
</script>

<style lang="scss">

</style>